home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-11-08 | 3.2 KB | 91 lines | [TEXT/MSWD] |
-
- ---------------------- Cut here -------------------------------
- -- Note: "Duk-akis" contains a dash here to prevent the vaccine from
- -- detecting itself as a virus.
-
- -- Script to detect the spread of the "Duk-akis" virus. It works by
- -- trapping the "set" command. I havenUt seen "Duk-akis", but I should
- -- think that it works by setting the scripts of various objects to
- -- whatever they were plus an "on openStack" handler. Well, by trapping
- -- the "set" command, we can then find out if we are setting a script.
- -- If we are, then we can sort of work like "Vaccine" does; i.e., we
- -- prompt the user to see if he or she wants to allow the command to
- -- continue. If it is stopped, then all scripts are halted.
-
- -- Additionally, if the script contains the word "Duk-akis", then no
- -- option is given & the script is halted straight away.
-
- -- THIS SCRIPT SHOULD BE INSTALLED IN THE "HOME" STACK,
- -- IN THE STACK SCRIPT.
-
- -- You can test this script by making a new stack, then keying the
- -- following examples into the message box:
- -- % "Set the script of this stack to empty"
- -- % "Set the script of this stack to field 1"
- -- % "set the script of this stack to Duk-akis" (don't type the dash)
-
- -- Try it, I think you'll like it!
-
- -- This script is free to everyone apart from the person who wrote the
- -- "Duk-akis" virus. I just hope it affects every single stack he or
- -- she has or gets in the future!
-
- -- Regards to all from a truely devoted HyperCard fan,
- -- Ian Summerfield
- -- Technical Support Supervisor
- -- Apple Computer UK Ltd.
- -- CIS: 76657, 742
- -- "Sysop" - AppleFone HyperCard BBS: Luton, England: 0582 584134
-
- -- Modified slightly 8/22/88 by Joe McMahon to make sure that
- --"set the scriptI" (vs. "set script") doesn't slip through.
-
- -- Modified a bit more 8/29/88 by Joe McMahon to add Ian's fixes
- -- to prevent the vaccine from detecting itself as a virus.
-
- on set
- put "Duk"&"akis" into duk
- if the param of 1 is "script" or the param of 2 is "script" then
- get the params
- if last word of it is "to" then put it && "empty" into it
- put it into s
- if s contains duk then
- repeat 10
- play harpsichord tempo 300 "a b c b a b c b"
- end repeat
- answer duk&&"virus detected!" with "Halt scripts"
- answer "Okay, you're safe now! It didn't spread."
- exit to HyperCard
- end if
- play harpsichord tempo 200 "e c e c e c e"
- answer "Warning: Script change requested" with "Show me"
- repeat
- answer s with "Allow" or "Stop!" or "Show more"
- if it is "Allow" then pass set
- else
- if it is "Stop!" then
- answer "All scripts halted!"
- exit to HyperCard
- else
- put the userLevel into userSafe
- set userLevel to 5
- doMenu "New Field"
- get the number of card fields
- set rect of card field it to 0,19,512,342
- set style of card field it to scrolling
- put the params into card field it
- choose browse tool
- wait until not the mouseClick
- wait until the mouseClick
- choose field tool
- click at loc of card field it
- doMenu "Clear Field"
- choose browse tool
- set userLevel to userSafe
- end if
- end if
- end repeat
- else pass set
- end set
-
-